package com.hxkj.dao;

import com.hxkj.domain.po.SysUser;

/**
 * created by kezhijie on 2018/8/21 9:35.
 * email to kezhijie@hxoss.com
 */
public interface UserDao {

    /**
     * 保存用户注册信息
     * @param sysUser
     * @return
     */
    int save(SysUser sysUser) throws Exception;

    /**
     * 动态保存用户信息
     * 会根据实体具体哪个字段有值进行保存
     * @param sysUser
     * @return
     */
    int saveSelective(SysUser sysUser) throws Exception;

    /**
     * 根据帐号名称查找用户
     * @param condition
     * @return
     */
    SysUser findExists(SysUser condition);

    /**
     * 修改用户信息
     * @param sysUser
     * @return
     * @throws Exception
     */
    int updateSelectiveExcludePassword(SysUser sysUser) throws Exception ;

    /**
     * 修改密码
     * @param sysUser
     * @return
     * @throws Exception
     */
    int updatePassword(SysUser sysUser) throws Exception;

    /**
     * 修改手机号
     * @param sysUser
     * @return
     * @throws Exception
     */
    int updatePhone(SysUser sysUser) throws Exception;

    /**
     * 根据userId查找用户信息
     * @param userId
     * @return
     */
    SysUser findByUserId(String userId) throws Exception;

    /**
     * 修改用户名
     * @param sysUser
     * @return
     * @throws Exception
     */
    int updateUserAccount(SysUser sysUser) throws Exception;

}
